/**
 * Copyright © 2024, ZhiYun Network Co.,Ltd. All rights reserved.
 * ZhiYun PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.itcoon.cloud.framework.springdoc.config;

import com.itcoon.cloud.framework.springdoc.enums.SecuritySchemeEnum;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName:com.itcoon.config.springdoc.framework.SpringDocConfigProperties
 * Description:
 *
 * Date: 10/6/24 11:18 PM
 *
 * @author: miaoxia.yu
 *
 * @version 1.0.0
 */

@ConfigurationProperties(prefix = "itcoon.web.springdoc")
public class SpringDocConfigProperties {

    private Server[] servers = new Server[]{
            new Server().url("http://localhost:8080").description("Local"),

    };

    @NestedConfigurationProperty
    private Info info = new Info();

    /**
     * /oauth2/authorize url
     */
    private String authorizationUrl;

    /**
     * /oauth2/token url
     */
    private String tokenUrl;

    /**
     * OIDC url
     */
    private String oidcUrl;


    private Map<String, String> scopesMap = new HashMap<String, String>() {
    };

    private SecuritySchemeEnum[] securitySchemes = new SecuritySchemeEnum[]{SecuritySchemeEnum.BASIC_AUTH};

    public Server[] getServers() {
        return servers;
    }

    public void setServers(Server[] servers) {
        this.servers = servers;
    }

    public Info getInfo() {
        return info;
    }

    public void setInfo(Info info) {
        this.info = info;
    }

    public String getAuthorizationUrl() {
        return authorizationUrl;
    }

    public void setAuthorizationUrl(String authorizationUrl) {
        this.authorizationUrl = authorizationUrl;
    }

    public String getTokenUrl() {
        return tokenUrl;
    }

    public void setTokenUrl(String tokenUrl) {
        this.tokenUrl = tokenUrl;
    }

    public String getOidcUrl() {
        return oidcUrl;
    }

    public void setOidcUrl(String oidcUrl) {
        this.oidcUrl = oidcUrl;
    }

    public Map<String, String> getScopesMap() {
        return scopesMap;
    }

    public void setScopesMap(Map<String, String> scopesMap) {
        this.scopesMap = scopesMap;
    }

    public SecuritySchemeEnum[] getSecuritySchemes() {
        return securitySchemes;
    }

    public void setSecuritySchemes(SecuritySchemeEnum[] securitySchemes) {
        this.securitySchemes = securitySchemes;
    }
}
